Skip to content

[#267] Indexing recovery UI for failed publish#280

Closed
realproject7 wants to merge 1 commit intomainfrom
task/267-indexing-recovery-ui
Closed

[#267] Indexing recovery UI for failed publish#280
realproject7 wants to merge 1 commit intomainfrom
task/267-indexing-recovery-ui

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

Fixes #267

  • usePublishIntent hook — localStorage-backed intent that tracks pending publishes across browser sessions. Saves before wallet confirmation, persists tx hash after on-chain confirmation, clears on indexing success, retains on failure with retry count.
  • usePublish integration — Intent lifecycle wired into the 5-state publish flow. User-rejected tx clears intent immediately (no false recovery). Indexer 409 treated as idempotent success.
  • PublishRecovery component — Recovery banner showing tx hash (linked to explorer), retry button, dismiss option, max retry warning (5 retries). Renders nothing when no pending intent exists.
  • Create + Chain pages — Recovery banner mounted on both src/app/create/page.tsx and src/app/chain/page.tsx.

Error classification

  • User rejected tx → intent cleared, no recovery
  • Tx confirmed, indexer fails → intent persisted with txHash, recovery UI on reload
  • Indexer 409 → idempotent success, intent cleared
  • Stale intents (24h, no txHash) → auto-cleaned on mount

Test plan

  • Normal publish flow works unchanged (intent saved + cleared transparently)
  • After simulated indexer failure: reload page shows recovery banner
  • Recovery banner shows tx hash linked to block explorer
  • "Retry Indexing" re-sends POST with all metadata
  • "Dismiss" clears the intent
  • User-rejected wallet tx does not trigger recovery on reload
  • Indexer 409 response clears the intent (no recovery shown)
  • Recovery works on both create page and chain page
  • Max retry count (5) shows warning message
  • npm run typecheck passes
  • npm run lint passes (no new warnings)

🤖 Generated with Claude Code

- New usePublishIntent hook: saves intent before wallet confirmation,
  persists tx hash after on-chain confirmation, clears on indexing
  success, retains on failure with retry count tracking
- Integrate intent lifecycle into usePublish: saveIntent before
  confirming, persistTxHash after receipt, clearIntent on success,
  clear on user-rejected tx (no false recovery)
- New PublishRecovery component: banner with tx hash link, retry
  indexing button, dismiss option, max retry count (5) warning
- Recovery UI mounted on create page and chain page
- Treats indexer 409 as idempotent success
- Stale intents (24h, no txHash) auto-cleaned on mount

Fixes #267

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES

Summary

The recovery flow is close, and CI is green, but the new error handling clears persisted publish intent for every wallet write failure. That breaks the issue's required distinction between user-rejected transactions and other sent/failed states.

Findings

  • [high] Non-rejection wallet errors now discard recovery state
    • File: src/hooks/usePublish.ts:95
    • Suggestion: Only clear the saved intent when the wallet error is positively identified as a user rejection. For other writeContractAsync failures, preserve the intent so the tx can still be recovered if it was broadcast or the failure was an ambiguous provider/network error.

Decision

Requesting changes because issue #267 explicitly requires correct classification of user-rejected transactions versus sent/confirmed failures, and the current catch block treats all wallet write errors as user rejection.

@realproject7
Copy link
Copy Markdown
Owner Author

Closing: stale implementation from before the revert. Issue #267 remains open for a fresh start.

@realproject7 realproject7 deleted the task/267-indexing-recovery-ui branch March 18, 2026 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] Front-end recovery UI for failed indexing after successful on-chain tx

2 participants